import request from '@/api/request'
import type { AxiosPromise } from 'axios'
export interface requestType {
  endDay: String
  startDay: String
}
export interface analysisType {
  startDay?: String
  endDay?: String
  pageIndex: Number
  pageSize: Number
  // isFirst?: Number
  // isSubmitted?: Number
}

export interface analysisWithDoctorId extends analysisType {
  doctorId: number
}

export interface analysisWithSubmit extends analysisType {
  submit: number
}
export interface asthmaDiagnosisType extends analysisType {
  diagnosis: Number
}
export interface PatientPefType extends analysisType {
  ageRange: Number
}

export interface PatientsByAsthmaTriggersType extends analysisType {
  triggers: Number
}

export interface TreatRecordsAndDoctorType extends analysisType {
  treatmentType: number
  doctorId: number
}
export interface TreatRecordsType extends analysisType {
  treatmentType: number
}
export interface TreatmentLevelType extends analysisType {
  level: number
}
export interface MarkedByLevelType extends analysisType {
  critical: number
}
/**
 * 获取概要
 * @param data requestType
 * @returns
 */
export function getSummary(data: requestType): AxiosPromise<any> {
  return request({
    url: '/emrweb/statistical/getSummary',
    method: 'get',
    params: data,
  })
}

/**
 * 获取总览
 * @param data requestType
 * @returns
 */
export function getDataOverview(data: requestType): AxiosPromise<any> {
  return request({
    url: '/emrweb/statistical/getDataOverview',
    method: 'get',
    params: data,
  })
}

/**
 * 获取患者打卡率
 * @param data requestType
 * @returns
 */
export function getMarkedRate(data: requestType): AxiosPromise<any> {
  return request({
    url: '/emrweb/statistical/getMarkedRate',
    method: 'get',
    params: data,
  })
}

/**
 * 获取底部一大堆数据
 */
export function getBottomData(data: requestType): AxiosPromise<any> {
  return request({
    url: '/emrweb/statistical/getBottomData',
    method: 'get',
    params: data,
  })
}

/**
 * 获取院内人员统计信息列表
 * @param data
 * @returns
 */
export function getHospitalStaffs(data: analysisType): AxiosPromise<any> {
  return request({
    url: '/emrweb/statistical/getHospitalStaffs',
    method: 'get',
    params: data,
  })
}
/************** 数据概要--表格里的详情 *******************/
/**
 * 获取行动计划制定人数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getActionPlansPatientsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getActionPlanPatients',
    method: 'get',
    params: data,
  })
}

/**
 * 获取行动计划制定总数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getActionPlansDetails(data: analysisType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getActionPlans',
    method: 'get',
    params: data,
  })
}

/**
 * 院内人员-行动计划数列表
 * @param data
 * @returns AxiosPromise
 */
export function getActionPlansByDoctorIdDetails(
  data: analysisWithDoctorId
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getActionPlansByDoctorId',
    method: 'get',
    params: data,
  })
}

/**
 * 累计行动计划制定总数列表
 * @param data
 * @returns AxiosPromise
 */
export function getAllActionPlansDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAllActionPlans',
    method: 'get',
    params: data,
  })
}

/**
 * 累计打卡列表
 * @param data
 * @returns AxiosPromise
 */
export function getAllMarkedListDetails(data: analysisType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAllMarkedList',
    method: 'get',
    params: data,
  })
}

/**
 * 院内人员-新增病历总数列表
 * @param data
 * @returns AxiosPromise
 */
export function getAllMedicalRecordsByDoctorIdDetails(
  data: analysisWithDoctorId
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAllMedicalRecordsByDoctorId',
    method: 'get',
    params: data,
  })
}

/**
 * 累计未或已提交病历数列表
 * @param data
 * @returns AxiosPromise
 */
export function getAllSubmitRecordsDetails(
  data: analysisWithSubmit
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAllSubmitRecords',
    method: 'get',
    params: data,
  })
}

/**
 * 累计病历总数列表
 * @param data
 * @returns AxiosPromise
 */
export function getAllTreatRecordsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAllTreatRecords',
    method: 'get',
    params: data,
  })
}

/**
 * 累计未打卡列表
 * @param data
 * @returns AxiosPromise
 */
export function getAllUnmarkedList(data: analysisType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAllUnmarkedList',
    method: 'get',
    params: data,
  })
}

/**
 * 哮喘评估控制次数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getAsthmaControlListDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAsthmaControlList',
    method: 'get',
    params: data,
  })
}

/**
 * 获取哮喘诊断列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getAsthmaDiagnosisListDetails(
  data: asthmaDiagnosisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getAsthmaDiagnosisList',
    method: 'get',
    params: data,
  })
}

/**
 * 呼吸音采集数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getBreathSoundListDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getBreathSoundList',
    method: 'get',
    params: data,
  })
}

/**
 * 获取确诊患者列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getDiagnosedPatientsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getDiagnosedPatients',
    method: 'get',
    params: data,
  })
}

/**
 * 累计停药人数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getDrugWithdrawalPatientsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getDrugWithdrawalPatients',
    method: 'get',
    params: data,
  })
}

/**
 * 累计管理患者列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getExistDiagnosisPatientsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getExistDiagnosisPatients',
    method: 'get',
    params: data,
  })
}

/**
 * 获取打了卡的患者列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getMarkedPatientsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getMarkedPatients',
    method: 'get',
    params: data,
  })
}

/**
 * 获取新患者信息列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getNewPatientsDetails(data: analysisType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getNewPatients',
    method: 'get',
    params: data,
  })
}

/**
 * 院内人员-患者数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getNewPatientsByDoctorIdDetails(
  data: analysisWithDoctorId
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getNewPatientsByDoctorId',
    method: 'get',
    params: data,
  })
}

/**
 * 新增首诊或复诊病历数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getNewTreatRecords(data: TreatRecordsType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getNewTreatRecords',
    method: 'get',
    params: data,
  })
}
/**
 * 院内人员-首诊或复诊病历总数列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getMedicalRecordsByDoctorIdDetails(
  data: TreatRecordsAndDoctorType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getMedicalRecordsByDoctorId',
    method: 'get',
    params: data,
  })
}
/**
 * 获取呼吸峰流速列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getPatientPefListDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getPatientPefList',
    method: 'get',
    params: data,
  })
}

/**
 * 获取符合年龄分布的患者列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getPatientsByAgeRangeDetails(
  data: PatientPefType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getPatientsByAgeRange',
    method: 'get',
    params: data,
  })
}

/**
 * 获取符合哮喘诱因的患者列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getPatientsByAsthmaTriggersDetails(
  data: PatientsByAsthmaTriggersType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getPatientsByAsthmaTriggers',
    method: 'get',
    params: data,
  })
}

/**
 * 院内人员-开方数列表
 * @param data
 * @returns
 */
export function getPrescriptionListDetails(
  data: analysisWithDoctorId
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getPrescriptionList',
    method: 'get',
    params: data,
  })
}
/**
 * 获取远程复诊记录列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getRemoteRecordsDetails(data: analysisType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getRemoteRecords',
    method: 'get',
    params: data,
  })
}

/**
 * 累计复诊患者列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getReturnVisitPatientsDetails(
  data: analysisType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getReturnVisitPatients',
    method: 'get',
    params: data,
  })
}
/**
 * 获取已提交就诊记录列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getSubmitRecordsDetails(
  data: analysisWithSubmit
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getSubmitRecords',
    method: 'get',
    params: data,
  })
}

/**
 * 获取累计首诊或累计复诊
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getTreatRecordsDetails(
  data: TreatRecordsType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getTreatRecords',
    method: 'get',
    params: data,
  })
}

/**
 * 获取治疗级别列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getTreatmentLevelListDetails(
  data: TreatmentLevelType
): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getTreatmentLevelList',
    method: 'get',
    params: data,
  })
}

/**
 * 获取行动计划执行数据列表
 * @param data analysisType
 * @returns AxiosPromise
 */
export function getMarkedByLevel(data: MarkedByLevelType): AxiosPromise<any> {
  return request({
    url: '/emrweb/analysis/getMarkedByLevel',
    method: 'get',
    params: data,
  })
}
